<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">hell</div>
</body>
</html>
<script>
    let data = {
        msg:'hell',
        count:1
    }
    var vm = {}
    proxyData(data)
    function proxyData(data){
        Object.keys(data).forEach(key=>{
            Object.defineProperties(vm,{
                [key]:{
                    enumerable:true,
                    configurable:true,
                    get(){
                        return data[key]
                    },
                    set(newValue){
                        if(newValue===data[key]){
                            return
                        }
                        data[key]=newValue
                        document.querySelector('#app').innerHTML = data[key]
                    }
                }
            })  
        }) 
    }
    
</script>